1. Field of the Invention
Embodiments of the invention generally relate to computer systems. More specifically, embodiments of the invention provide techniques to recover from a database connection failure.
2. Description of the Related Art
Databases are well known systems for storing, searching, and retrieving information stored in a computer. Access to a database may be provided by a client-server architecture, in which a client computer may connect to a server hosting a database. Typically, access to a particular database application is provided using a database driver. The database driver provides an application that allows a software application to interact with a database. By implementing a common interface, different database vendors allow the software application to interact with their particular database implementation. To interact with the database, the software application establishes a connection with the database, through the database driver, at a network address location for the database. Often, the network address is in the form of a socket, i.e., a combination of an internet protocol (IP) address and a port number. After a connection is established, however, in some situations, a server may become unavailable to a client. For example, a server may suffer a critical fault or error and be forced to shut down or a network connection between a software application and a database server at a particular network address may fail. Thus, the client computer may lose access to the database hosted by the server.
In such situations, the client computer may be connected to a database on a secondary server. More specifically, the secondary server (also referred to as a failover server) may provide the client computer with access to a back-up database that is equivalent to the database hosted on the unavailable server. However, in order to access the back-up database, the client computer needs to know a network address for connecting to the secondary server. Thus, there is a need for techniques for a client computer system to connect to a secondary server in order to recover from a database connection failure.